package com.hdey.service.chao.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdey.mapper.chao.ShenlingziMapper;
import com.hdey.pojo.chao.Shenlingzi;
import com.hdey.service.chao.ShenlingziService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service("shenlingziService")
@Transactional
public class ShenlingziServiceImpl extends ServiceImpl<ShenlingziMapper, Shenlingzi> implements ShenlingziService {

    @Resource
    private ShenlingziMapper shenlingziMapper;


    @Override
    public Page<Shenlingzi> searchPage(Integer current, Integer size, String applyMasterNo) {
        Page<Shenlingzi> page=new Page<>(current,size);
        LambdaQueryWrapper<Shenlingzi> wrapper=new LambdaQueryWrapper<>();
        wrapper.like(!StringUtils.isEmpty(applyMasterNo), Shenlingzi::getApplyMasterNo,applyMasterNo);
        //wrapper.eq(wuzi.getDictionaryId()!=null,Wuzi::getDictionaryId,wuzi.getDictionaryId());
        shenlingziMapper.selectPage(page,wrapper);
        return page;
    }
}
